<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8" />
    <title>注册页面</title>
    <script type="text/javascript" th:src="@{~/lib/js/jquery.min.js}"></script>
</head>
<body>
    <input type="hidden" name="id" id="Id" th:value="${user.id}" />
    账户：<input type="text" name="account" id="Account" th:value="${user.account}" />
    密码：<input type="password" name="password" id="Password" th:value="${user.password}" />
    <!--确认密码：<input type="password" name="again" id="Again" />-->
    <button name="register" id="Register">注册</button>
</body>
<script>
    $("#Register").click(function() {
        $.post("/login/save", {
            id: $("#Id").val(),
            account: $("#Account").val(),
            password: $("#Password").val()
        },
        function(result) {
            if (result == 0) {
                alert("注册成功");
            } else {
                alert("注册失败");
            }
        })
    })
</script>
</html>